<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/Public/Admin/extend/favicon.ico" >
    <link rel="Shortcut Icon" href="/Public/Admin/extend/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/Public/Admin/extend/lib/html5shiv.js"></script>
    <script type="text/javascript" src="/Public/Admin/extend/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="/Public/Admin/extend/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>系统配置</title>
    <link href="/Public/Admin/extend/lib/lightbox2/2.8.1/css/lightbox.css" rel="st ylesheet" type="text/css" >
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 系统配置
    </nav>
<div class="page-container">
   <!--   <form class="form form-horizontal" id="form-agency" method="post" action='<?php echo U("Agency/userAdd");?>'> -->
     <form class="form form-horizontal" id="form-agency">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">推荐搜索热搜词：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <input type="text" class="input-text" value="<?php echo ($shop_config['hot_keyword']); ?>" placeholder="请输入热搜词" id="hot_keyword" name="hot_keyword">
                <label class="col-sm-10" style="padding-left:0; color:#999;">显示在搜索栏下方的关键字，请用半角逗号（,）分隔</label>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">首页商品推荐数量：</label>
             <div class="formControls col-xs-4 col-sm-2">
                <input type="text" class="input-text" value="<?php echo ($shop_config['index_goods_number']); ?>"  placeholder="请输入数量" id="index_goods_number" name="index_goods_number" >
            </div>
        </div>
        <div class="cl">
            <label class="form-label col-xs-4 col-sm-3"></label>
            <div class="formControls col-xs-8 col-sm-5">
                <label class="col-sm-10" style="padding-left:0; color:#999;">在APP首页精品推荐中显示多少个商品</label>
            </div> 
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">视频关联商品数量：</label>
            <div class="formControls col-xs-8 col-sm-2">
                <input type="text" class="input-text" value="<?php echo ($shop_config['video_goods_number']); ?>" placeholder="请输入数量" id="video_goods_number" name="video_goods_number">
            </div>
        </div>
        <div class="cl">
            <label class="form-label col-xs-4 col-sm-3"></label>
            <div class="formControls col-xs-8 col-sm-5">
                <label class="col-sm-10" style="padding-left:0; color:#999;">在精彩视频中显示多少个关联商品</label>
            </div> 
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">商品列表分页数量：</label>
             <div class="formControls col-xs-8 col-sm-2">
                <input type="text" class="input-text" value="<?php echo ($shop_config['page_number']); ?>" placeholder="请输入数量" id="page_number" name="page_number" >
            </div>
        </div>
<div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">当日签到积分：</label>
             <div class="formControls col-xs-8 col-sm-2">
                <input type="text" class="input-text" value="<?php echo ($shop_config['sign_number']); ?>" placeholder="请输入积分数量" id="sign_number" name="sign_number" >
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">7天签到积分：</label>
             <div class="formControls col-xs-8 col-sm-2">
                <input type="text" class="input-text" value="<?php echo ($shop_config['sign_award']); ?>" placeholder="请输入积分数量" id="sign_award" name="sign_award" >
            </div>
        </div>
        <div class="cl">
            <label class="form-label col-xs-4 col-sm-3"></label>
            <div class="formControls col-xs-8 col-sm-5">
                <label class="col-sm-10" style="padding-left:0; color:#999;">连续7天签到奖励积分</label>
            </div> 
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" id='sub' value="&nbsp;&nbsp;保存&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/Public/Admin/extend/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->


<script type="text/javascript">

     $("#sub").click(function(e){
        e.preventDefault();
        var hot_keyword=$('#hot_keyword').val(),index_goods_number=$('#index_goods_number').val(),video_goods_number=$("#video_goods_number").val(),page_number=$("#page_number").val();
		
		var  sign_number = $('#sign_number').val();
		var  sign_award = $('#sign_award').val();

        if(index_goods_number==''){
             layer.msg('请输入首页商品推荐数量',{icon:2,time:1000});
             return false;
        }
        if(video_goods_number==''){
             layer.msg('请输入视频关联商品数量',{icon:2,time:1000});
             return false;
        }
		if(page_number==''){
             layer.msg('请输入商品列表分页数量',{icon:2,time:1000});
             return false;
        }

          $.ajax({
            type: 'POST',
            url: '<?php echo U("Admin/System/update_config");?>',
            data: {
                hot_keyword:hot_keyword,
                index_goods_number:index_goods_number,
                video_goods_number:video_goods_number,
                page_number:page_number,
				sign_number:sign_number,
				sign_award:sign_award,
            },
            dataType: 'json',
            success: function(data){
                layer.msg(data.info,{icon:1,time:1000});
                setTimeout((function() {
                    window.location.href='<?php echo U("Admin/System/config");?>';
                }), 1000);
              
            },
            error:function(data) {
                console.log(data.msg);
            },
        });  
             
    })
</script>
</body>
</html>